package ar.edu.unicen.exa.isistan.archassis.rcs;

import java.util.List;

import ar.edu.unicen.exa.isistan.archassis.DiffRequestData;

public class RCSFacade {
	private static final RCSFacade instance = new RCSFacade();
	private RCSFacade() {}
	public static RCSFacade getInstance() {
		return instance;
	}
	
	
	public void download(IRevisionControlSystem rcs, IVersion versionFrom, IVersion versionTo) throws RCSException {
		RCSFileDiffList fileDiffList = rcs.getDiff(versionFrom, versionTo);
		
		DiffRequestData tempFile = rcs.getDiffRequestData();
		
		//List<RCSFileDiff> listFD0 = Filter.filtrar(RCSFileModification.ADDED, listFD);
		List<RCSFileDiff> listFD0 = fileDiffList.remove(RCSFileModification.ADDED);
		rcs.checkOut(versionFrom, listFD0, tempFile);
		
		//List<RCSFileDiff> listFD1 = RCSFileDiffListFilter.filtrar(RCSFileModification.DELETED, listFD);
		List<RCSFileDiff> listFD1 = fileDiffList.remove(RCSFileModification.DELETED);
		rcs.checkOut(versionTo, listFD1, tempFile);
	}
}
